package ExerciseClass.Exercise33;

import java.util.Scanner;

public class huiwen {
    //正拼反拼都是相同的字符串
    // noon

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        boolean isFlag = true;
        System.out.print("请输入一段字符:");
        String stu = scanner.next();
        String stu1 = stu;
        for (int i = 0,j=stu.length()-1;i<stu.length()&&j>=0;j--,i++){
            if(stu.charAt(i)!=stu1.charAt(j)){
                isFlag=false;
                break;
            }
        }
        if(isFlag){
            System.out.println(stu+"是回文字符串");
        }else {
            System.out.println(stu+"不是回文字符串");
        }
    }
}
